import requestApi, { request } from "@/utils/service"
import type * as Login from "./types/login"

/** 获取登录验证码 */
export function getLoginCodeApi(id: string) {
  console.log(id)
  return request<Login.LoginCodeResponseData>({
    url: "web/verify/code/image",
    method: "get",
    params: {
      id
    }
  })
}

/** 登录并返回 Token */
export function loginApi(data: Login.LoginRequestData) {
  return requestApi.post({
    // url: "web/account/login",
    url: "user/login",
    data
  })
}

/** 获取用户详情 */
export function getUserInfoApi() {
  return requestApi.get({
    url: "web/account/user/center"
  })
}
